#include "../mqcommon/helpper.hpp"
#include "../mqcommon/logger.hpp"
#include "../mqcommon/mq_message.pb.h"  //消息的结构化描述在该部分使用protobuf生成
#include <iostream>
#include <string>
#include <mutex>
#include <memory>
#include <vector>
#include <functional>

namespace xgmq
{
    using ConsumerCallback = std::function<void(const std::string &, const basicProperties *bp, const std::string)>;
    // 定义消费者结构
    struct Consumer
    {
        using ptr = std::shared_ptr<Consumer>;
        std::string tag;   // 消费者的唯一标识
        std::string qname; // 该消费者订阅的队列
        bool auto_delete;  // 是否自动删除标志位
        ConsumerCallback callback;

        Consumer() {}
        Consumer(const std::string &ctag, const std::string &queue_name, bool is_delete,const ConsumerCallback &cb)
            : tag(ctag), qname(queue_name), auto_delete(is_delete), callback(cb)
        {
        }
    };
}